﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace DHQGHN.PM2.Models.DHQG
{
    public class NguoiDungChiTieuModel
    {
        public int ID { get; set; }
        public int CHI_TIEU_ID { get; set; }
        public int NAM_KE_HOACH_ID { get; set; }
        public int NAM_KE_HOACH { get; set; }
        public int DON_VI_ID { get; set; }
        public string TEN_DON_VI { get; set; }
        public int NGUOI_DUNG_ID { get; set; }
        public string TEN_CHI_TIEU { get; set; }
        public string TAI_KHOAN { get; set; }
        public string MA_CAP1 { get; set; }
        public int RECORD_COUNT { get; set; }
        public NguoiDungChiTieuModel()
        {
            CHI_TIEU_ID = 0;
            NAM_KE_HOACH_ID = 0;
            NGUOI_DUNG_ID = 0;
            DON_VI_ID = 0;
            TEN_CHI_TIEU = string.Empty;
            TAI_KHOAN = string.Empty;
            MA_CAP1 = string.Empty;
            TEN_DON_VI = string.Empty;
            NAM_KE_HOACH = 0;
        }

        public NguoiDungChiTieuModel(DAL.Models.DHQG.NguoiDungChiTieu model){
            this.ID = model.ID;
            this.CHI_TIEU_ID = model.CHI_TIEU_ID;
            this.DON_VI_ID = model.DON_VI_ID;
            this.MA_CAP1 = model.MA_CAP1;
            this.NAM_KE_HOACH_ID = model.NAM_KE_HOACH_ID;
            this.NGUOI_DUNG_ID = model.NGUOI_DUNG_ID;
            this.TAI_KHOAN = model.TAI_KHOAN;
            this.TEN_CHI_TIEU = model.TEN_CHI_TIEU;
            this.RECORD_COUNT = model.RECORD_COUNT;
        }

        public DAL.Models.DHQG.NguoiDungChiTieu ToDALModel()
        {
            DAL.Models.DHQG.NguoiDungChiTieu model = new DAL.Models.DHQG.NguoiDungChiTieu();
            model.ID = this.ID;
            model.CHI_TIEU_ID = this.CHI_TIEU_ID;
            model.DON_VI_ID = this.DON_VI_ID;
            model.MA_CAP1 = this.MA_CAP1;
            model.NAM_KE_HOACH_ID = this.NAM_KE_HOACH_ID;
            model.NGUOI_DUNG_ID = this.NGUOI_DUNG_ID;
            model.TAI_KHOAN = this.TAI_KHOAN;
            model.TEN_CHI_TIEU = this.TEN_CHI_TIEU;

            return model;
        }
    }
}